package com.PGD.services.StubDataService
{
	import com.PGD.model.constants.AnswerSetType;
	import com.PGD.model.factories.SlideFactory;
	import com.PGD.model.vos.Answer;
	import com.PGD.model.vos.AnswerSet;
	import com.PGD.model.vos.ISlide;
	import com.PGD.model.vos.ISlidePack;
	import com.PGD.model.vos.QuestionSlide;
	import com.PGD.model.vos.SlidePack;
	
	import mx.collections.ArrayCollection;
	import mx.utils.UIDUtil;

	public class StubDataService
	{
		public function StubDataService()
		{
			
		}
		
		public function getSlidePacks():ArrayCollection
		{
			var ac:ArrayCollection = new ArrayCollection;
			var sp:ISlidePack = new SlidePack();
			sp.id = UIDUtil.createUID();
			sp.creationDate = new Date();
			sp.name = "PGD";
			sp.textSlides = getSlides();
			sp.multipleChoiceQuestionSlides = getMQs();
			ac.addItem(sp);
			
			return ac;
			
		}

		public function getSlides():ArrayCollection
		{
			var ac:ArrayCollection = new ArrayCollection;
			for(var i:int; i<3; i++)
			{
			var slide:ISlide = new SlideFactory().makeNewTextSlide(i);
			slide.title = "Slide " +i+ " Title";
			slide.subtitle = "Subtitle "+i;
			slide.bodyText = '<TEXTFORMAT LEADING="2"><P ALIGN="LEFT"><FONT FACE="Verdana" SIZE="10" COLOR="#0B333C" LETTERSPACING="0" KERNING="0">Highlight some text here and then use the linkTextInput tool to create an HTML link. You&apos;ll see that the link gets underlined. This is customized behavior using Regular Expressions to edit the HTMLtext of the RightTextEditor.</FONT></P></TEXTFORMAT>';
			ac.addItem(slide);
			}
			return ac;
			
		}
		
		public function getMQs():ArrayCollection
		{
			var ac:ArrayCollection = new ArrayCollection;
			for(var i:int = 4; i<6; i++)
			{
			var slide:QuestionSlide = new SlideFactory().makeNewMultipleChoiceQuestionSlide(i);
			slide.title = "Qs " +i+ " Title";
			slide.subtitle = "Qs sub "+i;
			slide.bodyText = '<TEXTFORMAT LEADING="2"><P ALIGN="LEFT"><FONT FACE="Verdana" SIZE="10" COLOR="#0B333C" LETTERSPACING="0" KERNING="0">Highlight some text here and then use the linkTextInput tool to create an HTML link. You&apos;ll see that the link gets underlined. This is customized behavior using Regular Expressions to edit the HTMLtext of the RightTextEditor.</FONT></P></TEXTFORMAT>';
			slide.answerSet = getAnswerSet()
			ac.addItem(slide);
			}
			return ac;
		}
		
		private function getAnswerSet():AnswerSet
		{
			var answerSet:AnswerSet = new AnswerSet()	
			answerSet.setType = AnswerSetType.MULTIPLE_CHOICE;
			answerSet.answers = getAnswers();
			return answerSet;
		}
		public function getAnswers():ArrayCollection
		{
			var ac:ArrayCollection = new ArrayCollection;
			for(var i:int; i<3; i++)
			{
				var ans:Answer = new Answer;
				ans.answerText = UIDUtil.createUID();
				ans.order = i+1;
				ans.answerValue = '1';
				ac.addItem(ans);
			}
			return ac;
		}

		
	}
}